![]() |
OPC-UA Embedded Server SDK
2.1.0
|
Functions | |
| bool_t | UAServer_Callback_login_username_password (const UA_UTF8_string_t *username, const UA_UTF8_string_t *password, uint16_t *user_index) |
| bool_t | UAServer_Callback_login_x509_certificate (const UA_Byte_string_t *certificate, const UA_UTF8_string_t *thumbprint, uint16_t *user_index) |
| bool_t UAServer_Callback_login_username_password | ( | const UA_UTF8_string_t * | username, |
| const UA_UTF8_string_t * | password, | ||
| uint16_t * | user_index | ||
| ) |
Function provided by host to enable users to login
The library optionally requires the ability to authenticate users in order to operate. This ability is provided by this function which must be implemented by the host system. This function is called by the library to authenticate username/password combinations provided by a client when negotiating a session. The host maintains a table of valid user names and corresponding passwords. If the provided username & password authenticates successfully the host provides the library with a user index. The user index is a value from 1 to 15 indicating the user that has logged in. The user index provided by the host is used in conjunction with the node visibility bit mask to filter nodes visible to the current user.
Where (UA_INCLUDE_ASYNC_OPS is > 0) this callback may be called on different threads. Ensure you provide whatever locking is necessary for your platform when enabling asynchronous operation.
| [in] | username | The user name provided. |
| [in] | password | The password provided. |
| [out] | user_index | The user index for this user. Must be set if function returns true. |
| bool_t UAServer_Callback_login_x509_certificate | ( | const UA_Byte_string_t * | certificate, |
| const UA_UTF8_string_t * | thumbprint, | ||
| uint16_t * | user_index | ||
| ) |
Function provided by host to enable users to login
The library optionally requires the ability to authenticate users in order to operate. This ability is provided by this function which must be implemented by the host system although it is only necessary to handle the callback if the host configures the SDK to support X509 certificates for user authentication.
This function is called by the library to authenticate X509V3 certificates provided by a client when negotiating a session. The host maintains a table of valid certificates. If the provided thumbprint authenticates successfully the host provides the library with a user index. The user index is a value from 1 to 15 indicating the user that has logged in. The user index provided by the host is used in conjunction with the node visibility bit mask to filter nodes visible to the current user.
The certificate is provided here purely as a convenience to hosts that are interested in it. Only the thumbprint is required to identify the certificate and authenticate a user.
This callback will only be executed if the certificate first validates for trust, content, etc. using the user certificate trust and issuer stores.
Where (UA_INCLUDE_ASYNC_OPS is > 0) this callback may be called on different threads. Ensure you provide whatever locking is necessary for your platform when enabling asynchronous operation.
| [in] | certificate | The certificate provided by the client in DER format. |
| [in] | thumbprint | The certificate thumbprint. |
| [out] | user_index | The user index for this user. Must be set if function returns true. |